package com.sp.fresh_produce.controller.dto.req;

import jakarta.validation.constraints.NotNull;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 修改商品请求
 * <p>
 * 用于更新商品信息时的参数验证
 */
@Data
@EqualsAndHashCode(callSuper = true)
public class ProductUpdateRequest extends BaseProductRequest {

    @NotNull(message = "商品ID不能为空")
    private Integer id;
    
    @NotNull(message = "商品价格不能为空")
    @Override
    public Integer getPrice() {
        return super.getPrice();
    }

    @NotNull(message = "商品库存不能为空")
    @Override
    public Integer getStock() {
        return super.getStock();
    }
}
